public class AddingTwoLinkedListIntegers{
  public int addingTwo(Node n1, Node n2) {
    String str1 = "";
    String str2 = "";
    
    while( n1 != null ) {
      str1 = n1.data + str1;
      n1 = n1.next;
    }
    
    while( n2 != null ) {
      str2 = n2.data + str1;
      n2 = n2.next;
    }
    
    return Integer.parseInt(str1) + Integer.parseInt(str2);
  }
}